<template>
    <div>
        <el-table :data="tableData" style="width: 100%">

            <el-table-column prop="name" label="职位名称" width="300"></el-table-column>
            <el-table-column prop="company" label="所属公司" width="250"></el-table-column>
            <el-table-column prop="industry" label="公司行业" width="250"></el-table-column>
            <el-table-column prop="department" label="所属部门" width="250"></el-table-column>
            <el-table-column prop="time" label="入职时间" width="250"></el-table-column>
            <el-table-column prop="salary" label="薪酬" width="300"></el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        name: "EmpPos",
        created() {
            let hr = JSON.parse(window.sessionStorage.getItem("user")).user;

            hr.archive.positions.forEach((item) => {
                this.tableData.push({
                    name: item.name,
                    company: item.company.name,
                    industry: item.company.industry,
                    department: item.company.departments[0].name,
                    time: item.company.date,
                    salary: item.salary,
                })

            })
        },
        data() {
            return {
                unit: {
                    name: '',
                    company: '',
                    industry: '',
                    department: '',
                    time: '',
                    salary: '',
                },
                tableData: []
            }
        }
    };
</script>

<style scoped>
</style>